package com.puff.mapper;

import com.puff.annotation.AutoFill;
import com.puff.entity.Admin;
import com.puff.enumeration.OperationType;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface AdminMapper {

    /**
     * 根据username查询数据
     * @param username
     * @return
     */
    @Select("select * from admin where username = #{username}")
    Admin getByUsername(String username);

    /**
     * 修改数据
     * @param newAdmin
     */
    @AutoFill(OperationType.UPDATE)
    void update(Admin newAdmin);
}
